xen/sched: introduce cpupool_update_node_affinity()
authorJuergen Gross <jgross@suse.com>
Mon, 5 Sep 2022 07:00:03 +0000 (09:00 +0200)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 5 Sep 2022 10:42:30 +0000 (11:42 +0100)
commita83fa1e2b96ace65b45dde6954d67012633a082b
tree43daadf63a9befec51d3a19ea0faf06c754a3cc3
parente997d055929665b12246e89eb092dc79c65de9a4
xen/sched: introduce cpupool_update_node_affinity()

For updating the node affinities of all domains in a cpupool add a new
function cpupool_update_node_affinity().

In order to avoid multiple allocations of cpumasks carve out memory
allocation and freeing from domain_update_node_affinity() into new
helpers, which can be used by cpupool_update_node_affinity().

Modify domain_update_node_affinity() to take an additional parameter
for passing the allocated memory in and to allocate and free the memory
via the new helpers in case NULL was passed.

This will help later to pre-allocate the cpumasks in order to avoid
allocations in stop-machine context.

Signed-off-by: Juergen Gross <jgross@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/common/sched/core.c
xen/common/sched/cpupool.c
xen/common/sched/private.h
xen/include/xen/sched.h